home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Format 1995 June
/
MacFormat 25.iso
/
Shareware City
/
Developers
/
fortran-to-c-translator-11
/
Mac F2C 1.1
/
Mac F2C Libraries
/
libI77 Sources
/
access.c
next >
Wrap
Text File
|
1995-01-28
|
707b
|
47 lines
/*
This function returns 0 if file called fileName exists,
1 otherwise.
IMT 28 Nov 94
*/
#include <Files.h>
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr );
int access( char *fileName, int notUsed )
{
OSErr err;
short vRefNum;
FInfo info;
Str255 pFileName;
CopyCtoPstr( pFileName, fileName ); /* Make name a Pascal string */
err = GetFInfo( pFileName, 0, &info ); /* Check on the default volume */
if ( err )
return 1;
else
return 0;
}
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr )
{
short i;
char *p;
i = 0;
p = ((char *) pStr) + 1;
while ( *cStr && i < 255 )
{
*p++ = *cStr++;
i++;
}
*pStr = i;
return (StringPtr) pStr;
}